Skip to content

Build fixes for Android NDK (I18n.h, UserLocation.cpp)#21

Merged
willwade merged 2 commits into
mainfrom
feat/android-build-fixes
Jun 19, 2026
Merged

Build fixes for Android NDK (I18n.h, UserLocation.cpp)#21
willwade merged 2 commits into
mainfrom
feat/android-build-fixes

Conversation

@willwade

Copy link
Copy Markdown

Summary

Two small fixes that unblock building DasherCore with the Android NDK (needed by the new Dasher-Android frontend, which builds DasherCore with \BUILD_CAPI ON\ for arm64-v8a / x86_64).

1. \I18n.h\ — treat Android like iOS/Windows

#if defined(_WIN32) || defined(APPLE)\ → add || defined(ANDROID).

Android, like iOS and Windows, has no gettext/\libintl.h. It localises via the C API JSON runtime (\dasher_set_locale), exactly as the Apple and Windows frontends do. Without this, the build fails at #include <libintl.h>\ (the header is absent on the NDK).

2. \UserLocation.cpp\ — drop unused <sys/timeb.h>\

The header is included but never referenced (no \ time()\ / \struct timeb\ usage). \sys/timeb.h\ is deprecated and absent on the Android NDK, breaking the build. Removing the dead include is a no-op on every other platform.

Why these are safe

  • No behaviour change on Windows / macOS / Linux: _()\ stays a no-op on Win/Apple (unchanged), and the removed include was unused everywhere.
  • Android joins the same no-op-_\ group as the other C-API frontends.

Testing

  • Verified clang-format clean against the repo .clang-format\ (0 replacements on both files).
  • Builds end-to-end on Android NDK 27.0.12077973, CMake 3.22.1, for \�rm64-v8a\ and \x86_64\ — produces \libdasher.so\ consumed by the Dasher-Android JNI layer.

Frontend tracking this submodule pin: dasher-project/Dasher-Android (Phase 0 scaffold).

willwade added 2 commits June 18, 2026 23:19
Android, like iOS and Windows, does not have gettext/libintl.h. It uses
DasherCore's C API JSON localization (dasher_set_locale) for translated
parameter strings, exactly as the Apple and Windows frontends do.

Including <libintl.h> on Android breaks the build, so add __ANDROID__ to
the no-op _()/N_() branch alongside _WIN32 and __APPLE__.

This unblocks the Dasher-Android frontend (C-API + JNI), which builds
DasherCore with BUILD_CAPI ON for arm64-v8a/x86_64.

Signed-off-by: will wade <willwade@gmail.com>
The header is included but never referenced (no ftime()/struct timeb
usage). sys/timeb.h is deprecated and absent on Android NDK, breaking
the build. Removing the dead include fixes Android without affecting
other platforms.

Signed-off-by: will wade <willwade@gmail.com>
@willwade willwade merged commit 136392c into main Jun 19, 2026
13 checks passed
@willwade willwade deleted the feat/android-build-fixes branch June 19, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant